GetProp {Cable}

GetProp

Syntax

SapObject.SapModel.PropCable.GetProp

VB6 Procedure

Function GetProp(ByVal Name As String, ByRef MatProp As String, ByRef Area As Double, ByRef Color As Long, ByRef Notes As String, ByRef GUID As String) As Long

Parameters

Name

The name of an existing cable property.

MatProp

The name of the material property assigned to the cable property.

Area

The cross-sectional area of the cable. [L
2
]

Color

The display color assigned to the property.

Notes

The notes, if any, assigned to the property.

GUID

The GUID (global unique identifier), if any, assigned to the property.

Remarks

This function retrieves cable property definition data.

The function returns zero if the property data is successfully retrieved; otherwise it returns a nonzero value.

VBA Example

Sub GetCableProperty()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim ret As Long

Dim Name As String

Dim MatProp As String

Dim Area As Double

Dim Color As Long

Dim Notes As String

Dim GUID As String

'create Sap2000 object

Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")

'start Sap2000 application

SapObject.ApplicationStart

'create SapModel object

Set SapModel = SapObject.SapModel

'initialize model

ret = SapModel.InitializeNewModel

'create model from template

ret = SapModel.File.New2DFrame(PortalFrame, 2, 144, 2, 288)

'add material

ret = SapModel.PropMaterial.AddQuick(Name, MATERIAL_TENDON, , , , , , MATERIAL_TENDON_SUBTYPE_ASTM_A416Gr270)

'set new cable property

ret = SapModel.PropCable.SetProp("C1", Name, 2.25)

'get cable property data

ret = SapModel.PropCable.GetProp("C1", MatProp, Area, Color, Notes, GUID)

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.02.

See Also

SetProp